home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Developer CD Series 1995 February: Tool Chest
/
Dev.CD Feb 95
/
Dev.CD Feb 95.toast
/
Tool Chest
/
Development Tools & Languages
/
• Other Platforms
/
PCCTS
/
testcpp
/
8
/
test.g
< prev
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
Text File
|
1994-09-14
|
394 b
|
22 lines
|
[
TEXT/MPS
]
/* This is test.g which tests a simple DLG-based scanner, but with
* a main() in another file.
*/
<<
typedef ANTLRCommonToken ANTLRToken;
>>
#token "[\ \t\n]+" <<skip();>>
#token Eof "@"
class Expr { /* Define a grammar class */
e : IDENTIFIER NUMBER Eof
<<fprintf(stderr, "text is %s,%s\n", $1->getText(), $2->getText());>>
;
}
#token IDENTIFIER "[a-z]+"
#token NUMBER "[0-9]+"